package com.ymatou.smstransfer.api.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.smstransfer.api.parameter.InitiateBean;
import com.ymatou.smstransfer.api.service.InitiateCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*语音验证码
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_Initiate{
	private static InitiateBean initiateBean;
	private static InitiateCall initiateCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("语音验证码");
	}

	@Before
	public void caseUp() {
		initiateBean=new InitiateBean();
		initiateCall=new InitiateCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(initiateCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_Initiate_001() {
		Logger.start(true,"发送语音验证码成功");
		try {
			//TODO 验证真实手机是否收到语音验证码 
			initiateBean.setLanguage("zh-cn");
			initiateBean.setPhoneNumber("8613585777478");
			initiateBean.setVerifyCode("2111");
			initiateCall.setData(initiateBean);
			initiateCall.callService();			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}